<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    const arr1 = [
        {date:'2021-12-01',price:"",stocks:""},
        {date:'2021-12-02',price:"",stocks:""},
        {date:'2021-12-03',price:"",stocks:""},
        {date:'2021-12-04',price:"",stocks:""},
        {date:'2021-12-05',price:"",stocks:""},
        {date:'2021-12-06',price:"",stocks:""},
        {date:'2021-12-22',price:"",stocks:""},
        {date:'2021-12-23',price:"",stocks:""},
        {date:'2021-12-24',price:"",stocks:""},
        {date:'2021-12-25',price:"",stocks:""},
        {date:'2021-12-26',price:"",stocks:""},
        {date:'2021-12-27',price:"",stocks:""},
        {date:'2021-12-28',price:"",stocks:""},
    ]
    const arr2 = [
        {date:'2021-12-22',price:"11",stocks:"12"},
        {date:'2021-12-23',price:"12",stocks:"12"},
        {date:'2021-12-24',price:"12",stocks:"12"},
        {date:'2021-12-25',price:"12",stocks:"12"},
        {date:'2021-12-26',price:"12",stocks:"12"},
        {date:'2021-12-27',price:"12",stocks:"12"},
        {date:'2021-12-28',price:"12",stocks:"12"},
    ]

    const arr3 = arr1.reduce((data,current)=>{
        const flag = arr2.find(e => current.date === e.date)
        data.push( flag || current)
        return data
    },[])
    console.log(arr3)

</script>
</body>
</html>
